<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<!-- v-model可以便捷的设置和获取表单元素值 -->
	<body>
		<div id="app">
			<input type="text" v-model="message" />
			<input type="button" @click="judge" value="判断" />
		</div>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script>
			var app = new Vue({
				el:"#app",
				data:{
					message:"hello"
				},
				methods:{
					judge:function(){
						if(this.message>=18){
							console.log("进入");
						}else{
							console.log("不可进入");
						}
					}
				}
			})
		</script>
	</body>
</html>
